package com.ddpt.permission.dubbo;

import com.lh.center.cache.task.AbstractDelayQueueTask;
import com.lh.center.common.task.TaskRetryService;
import com.lh.center.common.util.AssertUtil;
import com.lh.center.common.util.SpringUtils;
import org.apache.dubbo.config.annotation.DubboService;

@DubboService(group = "permission", interfaceName = "com.lh.center.common.task.TaskRetryService")
public class DubboPermissionTaskRetryServiceImpl implements TaskRetryService {

    @Override
    public void retry(String beanName, String taskValue) {
        Object bean = SpringUtils.getBean(beanName);
        AssertUtil.isNull(bean,"任务beanName不存在");
        AbstractDelayQueueTask task = (AbstractDelayQueueTask) bean;
        task.createTask(0L,taskValue);
    }
}
